﻿(function() {

function execute() {
Type._registerScript("ACTCommon.js", ["MicrosoftAjaxComponentModel.js", "MicrosoftAjaxGlobalization.js"]);
    Type.registerNamespace('AjaxControlToolkit'); AjaxControlToolkit.BoxSide = function() {
    }
    AjaxControlToolkit.BoxSide.prototype = {
        Top: 0,
        Right: 1,
        Bottom: 2,
        Left: 3
    }
    AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false); AjaxControlToolkit._CommonToolkitScripts = function() {
    }
    AjaxControlToolkit._CommonToolkitScripts.prototype = {
        _borderStyleNames: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
        _borderWidthNames: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
        _paddingWidthNames: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
        _marginWidthNames: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
        getCurrentStyle: function(element, attribute, defaultValue) {
            var currentValue = null; if (element) {
                if (element.currentStyle) {
                    currentValue = element.currentStyle[attribute];
                } else if (document.defaultView && document.defaultView.getComputedStyle) {
                    var style = document.defaultView.getComputedStyle(element, null); if (style) {
                        currentValue = style[attribute];
                    }
                }
                if (!currentValue && element.style.getPropertyValue) {
                    currentValue = element.style.getPropertyValue(attribute);
                }
                else if (!currentValue && element.style.getAttribute) {
                    currentValue = element.style.getAttribute(attribute);
                }
            }
            if ((!currentValue || currentValue == "" || typeof (currentValue) === 'undefined')) {
                if (typeof (defaultValue) != 'undefined') {
                    currentValue = defaultValue;
                }
                else {
                    currentValue = null;
                }
            }
            return currentValue;
        },
        getInheritedBackgroundColor: function(element) {
            if (!element) return '#FFFFFF'; var background = this.getCurrentStyle(element, 'backgroundColor'); try {
                while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
                    element = element.parentNode; if (!element) {
                        background = '#FFFFFF';
                    } else {
                        background = this.getCurrentStyle(element, 'backgroundColor');
                    }
                }
            } catch (ex) {
                background = '#FFFFFF';
            }
            return background;
        },
        getLocation: function(element) {
            if (element === document.documentElement) {
                return new Sys.UI.Point(0, 0);
            }
            if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
                if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0, 0); var screenRects = element.getClientRects(); if (!screenRects || !screenRects.length) {
                    return new Sys.UI.Point(0, 0);
                }
                var first = screenRects[0]; var dLeft = 0; var dTop = 0; var inFrame = false; try {
                    inFrame = element.ownerDocument.parentWindow.frameElement;
                } catch (ex) {
                    inFrame = true;
                }
                if (inFrame) {
                    var clientRect = element.getBoundingClientRect(); if (!clientRect) {
                        return new Sys.UI.Point(0, 0);
                    }
                    var minLeft = first.left; var minTop = first.top; for (var i = 1; i < screenRects.length; i++) {
                        var r = screenRects[i]; if (r.left < minLeft) {
                            minLeft = r.left;
                        }
                        if (r.top < minTop) {
                            minTop = r.top;
                        }
                    }
                    dLeft = minLeft - clientRect.left; dTop = minTop - clientRect.top;
                }
                var ownerDocument = element.document.documentElement; return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);
            }
            return Sys.UI.DomElement.getLocation(element);
        },
        setLocation: function(element, point) {
            Sys.UI.DomElement.setLocation(element, point.x, point.y);
        },
        getContentSize: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            var size = this.getSize(element); var borderBox = this.getBorderBox(element); var paddingBox = this.getPaddingBox(element); return {
                width: size.width - borderBox.horizontal - paddingBox.horizontal,
                height: size.height - borderBox.vertical - paddingBox.vertical
            }
        },
        getSize: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            return {
                width: element.offsetWidth,
                height: element.offsetHeight
            };
        },
        setContentSize: function(element, size) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (!size) {
                throw Error.argumentNull('size');
            }
            if (this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
                var borderBox = this.getBorderBox(element); var paddingBox = this.getPaddingBox(element); size = {
                    width: size.width + borderBox.horizontal + paddingBox.horizontal,
                    height: size.height + borderBox.vertical + paddingBox.vertical
                };
            }
            element.style.width = size.width.toString() + 'px'; element.style.height = size.height.toString() + 'px';
        },
        setSize: function(element, size) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (!size) {
                throw Error.argumentNull('size');
            }
            var borderBox = this.getBorderBox(element); var paddingBox = this.getPaddingBox(element); var contentSize = {
                width: size.width - borderBox.horizontal - paddingBox.horizontal,
                height: size.height - borderBox.vertical - paddingBox.vertical
            }; this.setContentSize(element, contentSize);
        },
        getBounds: function(element) {
            var offset = $common.getLocation(element); return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
        },
        setBounds: function(element, bounds) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (!bounds) {
                throw Error.argumentNull('bounds');
            }
            this.setSize(element, bounds); $common.setLocation(element, bounds);
        },
        getClientBounds: function() {
            var clientWidth; var clientHeight; switch (Sys.Browser.agent) {
                case Sys.Browser.InternetExplorer:
                    clientWidth = document.documentElement.clientWidth; clientHeight = document.documentElement.clientHeight; break; case Sys.Browser.Safari:
                    clientWidth = window.innerWidth; clientHeight = window.innerHeight; break; case Sys.Browser.Opera:
                    clientWidth = Math.min(window.innerWidth, document.body.clientWidth); clientHeight = Math.min(window.innerHeight, document.body.clientHeight); break; default:
                    clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth); clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight); break;
            }
            return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
        },
        getMarginBox: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            var box = {
                top: this.getMargin(element, AjaxControlToolkit.BoxSide.Top),
                right: this.getMargin(element, AjaxControlToolkit.BoxSide.Right),
                bottom: this.getMargin(element, AjaxControlToolkit.BoxSide.Bottom),
                left: this.getMargin(element, AjaxControlToolkit.BoxSide.Left)
            }; box.horizontal = box.left + box.right; box.vertical = box.top + box.bottom; return box;
        },
        getBorderBox: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            var box = {
                top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
                right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
                bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
                left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
            }; box.horizontal = box.left + box.right; box.vertical = box.top + box.bottom; return box;
        },
        getPaddingBox: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            var box = {
                top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
                right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
                bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
                left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
            }; box.horizontal = box.left + box.right; box.vertical = box.top + box.bottom; return box;
        },
        isBorderVisible: function(element, boxSide) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
                throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
            }
            var styleName = this._borderStyleNames[boxSide]; var styleValue = this.getCurrentStyle(element, styleName); return styleValue != "none";
        },
        getMargin: function(element, boxSide) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
                throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
            }
            var styleName = this._marginWidthNames[boxSide]; var styleValue = this.getCurrentStyle(element, styleName); try { return this.parsePadding(styleValue); } catch (ex) { return 0; }
        },
        getBorderWidth: function(element, boxSide) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
                throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
            }
            if (!this.isBorderVisible(element, boxSide)) {
                return 0;
            }
            var styleName = this._borderWidthNames[boxSide]; var styleValue = this.getCurrentStyle(element, styleName); return this.parseBorderWidth(styleValue);
        },
        getPadding: function(element, boxSide) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
                throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));
            }
            var styleName = this._paddingWidthNames[boxSide]; var styleValue = this.getCurrentStyle(element, styleName); return this.parsePadding(styleValue);
        },
        parseBorderWidth: function(borderWidth) {
            if (!this._borderThicknesses) {
                var borderThicknesses = {}; var div0 = document.createElement('div'); div0.style.visibility = 'hidden'; div0.style.position = 'absolute'; div0.style.fontSize = '1px'; document.body.appendChild(div0)
                var div1 = document.createElement('div'); div1.style.height = '0px'; div1.style.overflow = 'hidden'; div0.appendChild(div1); var base = div0.offsetHeight; div1.style.borderTop = 'solid black'; div1.style.borderTopWidth = 'thin'; borderThicknesses['thin'] = div0.offsetHeight - base; div1.style.borderTopWidth = 'medium'; borderThicknesses['medium'] = div0.offsetHeight - base; div1.style.borderTopWidth = 'thick'; borderThicknesses['thick'] = div0.offsetHeight - base; div0.removeChild(div1); document.body.removeChild(div0); this._borderThicknesses = borderThicknesses;
            }
            if (borderWidth) {
                switch (borderWidth) {
                    case 'thin':
                    case 'medium':
                    case 'thick':
                        return this._borderThicknesses[borderWidth]; case 'inherit':
                        return 0;
                }
                var unit = this.parseUnit(borderWidth); Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit, unit.type)); return unit.size;
            }
            return 0;
        },
        parsePadding: function(padding) {
            if (padding) {
                if (padding == 'inherit') {
                    return 0;
                }
                var unit = this.parseUnit(padding); Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit, unit.type)); return unit.size;
            }
            return 0;
        },
        parseUnit: function(value) {
            if (!value) {
                throw Error.argumentNull('value');
            }
            value = value.trim().toLowerCase(); var l = value.length; var s = -1; for (var i = 0; i < l; i++) {
                var ch = value.substr(i, 1); if ((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
                    break;
                }
                s = i;
            }
            if (s == -1) {
                throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);
            }
            var type; var size; if (s < (l - 1)) {
                type = value.substring(s + 1).trim();
            } else {
                type = 'px';
            }
            size = parseFloat(value.substr(0, s + 1)); if (type == 'px') {
                size = Math.floor(size);
            }
            return {
                size: size,
                type: type
            };
        },
        getElementOpacity: function(element) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            var hasOpacity = false; var opacity; if (element.filters) {
                var filters = element.filters; if (filters.length !== 0) {
                    var alphaFilter = filters['DXImageTransform.Microsoft.Alpha']; if (alphaFilter) {
                        opacity = alphaFilter.opacity / 100.0; hasOpacity = true;
                    }
                }
            }
            else {
                opacity = this.getCurrentStyle(element, 'opacity', 1); hasOpacity = true;
            }
            if (hasOpacity === false) {
                return 1.0;
            }
            return parseFloat(opacity);
        },
        setElementOpacity: function(element, value) {
            if (!element) {
                throw Error.argumentNull('element');
            }
            if (element.filters) {
                var filters = element.filters; var createFilter = true; if (filters.length !== 0) {
                    var alphaFilter = filters['DXImageTransform.Microsoft.Alpha']; if (alphaFilter) {
                        createFilter = false; alphaFilter.opacity = value * 100;
                    }
                }
                if (createFilter) {
                    element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';
                }
            }
            else {
                element.style.opacity = value;
            }
        },
        getVisible: function(element) {
            return (element &&
    ("none" != $common.getCurrentStyle(element, "display")) &&
    ("hidden" != $common.getCurrentStyle(element, "visibility")));
        },
        setVisible: function(element, value) {
            if (element && value != $common.getVisible(element)) {
                if (value) {
                    if (element.style.removeAttribute) {
                        element.style.removeAttribute("display");
                    } else {
                        element.style.removeProperty("display");
                    }
                } else {
                    element.style.display = 'none';
                }
                element.style.visibility = value ? 'visible' : 'hidden';
            }
        },
        resolveFunction: function(value) {
            if (value) {
                if (value instanceof Function) {
                    return value;
                } else if (String.isInstanceOfType(value) && value.length > 0) {
                    var func; if ((func = window[value]) instanceof Function) {
                        return func;
                    } else if ((func = eval(value)) instanceof Function) {
                        return func;
                    }
                }
            }
            return null;
        },
        addCssClasses: function(element, classNames) {
            for (var i = 0; i < classNames.length; i++) {
                Sys.UI.DomElement.addCssClass(element, classNames[i]);
            }
        },
        removeCssClasses: function(element, classNames) {
            for (var i = 0; i < classNames.length; i++) {
                Sys.UI.DomElement.removeCssClass(element, classNames[i]);
            }
        },
        setStyle: function(element, style) {
            $common.applyProperties(element.style, style);
        },
        removeHandlers: function(element, events) {
            for (var name in events) {
                $removeHandler(element, name, events[name]);
            }
        },
        overlaps: function(r1, r2) {
            return r1.x < (r2.x + r2.width)
    && r2.x < (r1.x + r1.width)
    && r1.y < (r2.y + r2.height)
    && r2.y < (r1.y + r1.height);
        },
        containsPoint: function(rect, x, y) {
            return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height);
        },
        isKeyDigit: function(keyCode) {
            return (0x30 <= keyCode && keyCode <= 0x39);
        },
        isKeyNavigation: function(keyCode) {
            return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down);
        },
        padLeft: function(text, size, ch, truncate) {
            return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false);
        },
        padRight: function(text, size, ch, truncate) {
            return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false);
        },
        _pad: function(text, size, ch, side, truncate) {
            text = text.toString(); var length = text.length; var builder = new Sys.StringBuilder(); if (side == 'r') {
                builder.append(text);
            }
            while (length < size) {
                builder.append(ch); length++;
            }
            if (side == 'l') {
                builder.append(text);
            }
            var result = builder.toString(); if (truncate && result.length > size) {
                if (side == 'l') {
                    result = result.substr(result.length - size, size);
                } else {
                    result = result.substr(0, size);
                }
            }
            return result;
        },
        __DOMEvents: {
            focusin: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focusin", true, false, window, 1); } },
            focusout: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focusout", true, false, window, 1); } },
            activate: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("activate", true, true, window, 1); } },
            focus: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("focus", false, false, window, 1); } },
            blur: { eventGroup: "UIEvents", init: function(e, p) { e.initUIEvent("blur", false, false, window, 1); } },
            click: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            dblclick: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            mousedown: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            mouseup: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            mouseover: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            mousemove: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            mouseout: { eventGroup: "MouseEvents", init: function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null); } },
            load: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("load", false, false); } },
            unload: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("unload", false, false); } },
            select: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("select", true, false); } },
            change: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("change", true, false); } },
            submit: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("submit", true, true); } },
            reset: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("reset", true, false); } },
            resize: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("resize", true, false); } },
            scroll: { eventGroup: "HTMLEvents", init: function(e, p) { e.initEvent("scroll", true, false); } }
        },
        tryFireRawEvent: function(element, rawEvent) {
            try {
                if (element.fireEvent) {
                    element.fireEvent("on" + rawEvent.type, rawEvent); return true;
                } else if (element.dispatchEvent) {
                    element.dispatchEvent(rawEvent); return true;
                }
            } catch (e) {
            }
            return false;
        },
        tryFireEvent: function(element, eventName, properties) {
            try {
                if (document.createEventObject) {
                    var e = document.createEventObject(); $common.applyProperties(e, properties || {}); element.fireEvent("on" + eventName, e); return true;
                } else if (document.createEvent) {
                    var def = $common.__DOMEvents[eventName]; if (def) {
                        var e = document.createEvent(def.eventGroup); def.init(e, properties || {}); element.dispatchEvent(e); return true;
                    }
                }
            } catch (e) {
            }
            return false;
        },
        wrapElement: function(innerElement, newOuterElement, newInnerParentElement) {
            var parent = innerElement.parentNode; parent.replaceChild(newOuterElement, innerElement); (newInnerParentElement || newOuterElement).appendChild(innerElement);
        },
        unwrapElement: function(innerElement, oldOuterElement) {
            var parent = oldOuterElement.parentNode; if (parent != null) {
                $common.removeElement(innerElement); parent.replaceChild(innerElement, oldOuterElement);
            }
        },
        removeElement: function(element) {
            var parent = element.parentNode; if (parent != null) {
                parent.removeChild(element);
            }
        },
        applyProperties: function(target, properties) {
            for (var p in properties) {
                var pv = properties[p]; if (pv != null && Object.getType(pv) === Object) {
                    var tv = target[p]; $common.applyProperties(tv, pv);
                } else {
                    target[p] = pv;
                }
            }
        },
        createElementFromTemplate: function(template, appendToParent, nameTable) {
            if (typeof (template.nameTable) != 'undefined') {
                var newNameTable = template.nameTable; if (String.isInstanceOfType(newNameTable)) {
                    newNameTable = nameTable[newNameTable];
                }
                if (newNameTable != null) {
                    nameTable = newNameTable;
                }
            }
            var elementName = null; if (typeof (template.name) !== 'undefined') {
                elementName = template.name;
            }
            var elt = document.createElement(template.nodeName); if (typeof (template.name) !== 'undefined' && nameTable) {
                nameTable[template.name] = elt;
            }
            if (typeof (template.parent) !== 'undefined' && appendToParent == null) {
                var newParent = template.parent; if (String.isInstanceOfType(newParent)) {
                    newParent = nameTable[newParent];
                }
                if (newParent != null) {
                    appendToParent = newParent;
                }
            }
            if (typeof (template.properties) !== 'undefined' && template.properties != null) {
                $common.applyProperties(elt, template.properties);
            }
            if (typeof (template.cssClasses) !== 'undefined' && template.cssClasses != null) {
                $common.addCssClasses(elt, template.cssClasses);
            }
            if (typeof (template.events) !== 'undefined' && template.events != null) {
                $addHandlers(elt, template.events);
            }
            if (typeof (template.visible) !== 'undefined' && template.visible != null) {
                this.setVisible(elt, template.visible);
            }
            if (appendToParent) {
                appendToParent.appendChild(elt);
            }
            if (typeof (template.opacity) !== 'undefined' && template.opacity != null) {
                $common.setElementOpacity(elt, template.opacity);
            }
            if (typeof (template.children) !== 'undefined' && template.children != null) {
                for (var i = 0; i < template.children.length; i++) {
                    var subtemplate = template.children[i]; $common.createElementFromTemplate(subtemplate, elt, nameTable);
                }
            }
            var contentPresenter = elt; if (typeof (template.contentPresenter) !== 'undefined' && template.contentPresenter != null) {
                contentPresenter = nameTable[contentPresenter];
            }
            if (typeof (template.content) !== 'undefined' && template.content != null) {
                var content = template.content; if (String.isInstanceOfType(content)) {
                    content = nameTable[content];
                }
                if (content.parentNode) {
                    $common.wrapElement(content, elt, contentPresenter);
                } else {
                    contentPresenter.appendChild(content);
                }
            }
            return elt;
        },
        prepareHiddenElementForATDeviceUpdate: function() {
            var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts'); if (!objHidden) {
                var objHidden = document.createElement('input'); objHidden.setAttribute('type', 'hidden'); objHidden.setAttribute('value', '1'); objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts'); objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts'); if (document.forms[0]) {
                    document.forms[0].appendChild(objHidden);
                }
            }
        },
        updateFormToRefreshATDeviceBuffer: function() {
            var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts'); if (objHidden) {
                if (objHidden.getAttribute('value') == '1') {
                    objHidden.setAttribute('value', '0');
                } else {
                    objHidden.setAttribute('value', '1');
                }
            }
        }
    }
    var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts(); var $common = CommonToolkitScripts; Sys.UI.DomElement.getVisible = $common.getVisible; Sys.UI.DomElement.setVisible = $common.setVisible; Sys.UI.Control.overlaps = $common.overlaps; AjaxControlToolkit._DomUtility = function() {
    }
    AjaxControlToolkit._DomUtility.prototype = {
        isDescendant: function(ancestor, descendant) {
            for (var n = descendant.parentNode; n != null; n = n.parentNode) {
                if (n == ancestor) return true;
            }
            return false;
        },
        isDescendantOrSelf: function(ancestor, descendant) {
            if (ancestor === descendant)
                return true; return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
        },
        isAncestor: function(descendant, ancestor) {
            return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
        },
        isAncestorOrSelf: function(descendant, ancestor) {
            if (descendant === ancestor)
                return true; return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);
        },
        isSibling: function(self, sibling) {
            var parent = self.parentNode; for (var i = 0; i < parent.childNodes.length; i++) {
                if (parent.childNodes[i] == sibling) return true;
            }
            return false;
        }
    }
    AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility"); AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility(); AjaxControlToolkit.TextBoxWrapper = function(element) {
        AjaxControlToolkit.TextBoxWrapper.initializeBase(this, [element]); this._current = element.value; this._watermark = null; this._isWatermarked = false;
    }
    AjaxControlToolkit.TextBoxWrapper.prototype = {
        dispose: function() {
            this.get_element().AjaxControlToolkitTextBoxWrapper = null; AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this, 'dispose');
        },
        get_Current: function() {
            this._current = this.get_element().value; return this._current;
        },
        set_Current: function(value) {
            this._current = value; this._updateElement();
        },
        get_Value: function() {
            if (this.get_IsWatermarked()) {
                return "";
            } else {
                return this.get_Current();
            }
        },
        set_Value: function(text) {
            this.set_Current(text); if (!text || (0 == text.length)) {
                if (null != this._watermark) {
                    this.set_IsWatermarked(true);
                }
            } else {
                this.set_IsWatermarked(false);
            }
        },
        get_Watermark: function() {
            return this._watermark;
        },
        set_Watermark: function(value) {
            this._watermark = value; this._updateElement();
        },
        get_IsWatermarked: function() {
            return this._isWatermarked;
        },
        set_IsWatermarked: function(isWatermarked) {
            if (this._isWatermarked != isWatermarked) {
                this._isWatermarked = isWatermarked; this._updateElement(); this._raiseWatermarkChanged();
            }
        },
        _updateElement: function() {
            var element = this.get_element(); if (this._isWatermarked) {
                if (element.value != this._watermark) {
                    element.value = this._watermark;
                }
            } else {
                if (element.value != this._current) {
                    element.value = this._current;
                }
            }
        },
        add_WatermarkChanged: function(handler) {
            this.get_events().addHandler("WatermarkChanged", handler);
        },
        remove_WatermarkChanged: function(handler) {
            this.get_events().removeHandler("WatermarkChanged", handler);
        },
        _raiseWatermarkChanged: function() {
            var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged"); if (onWatermarkChangedHandler) {
                onWatermarkChangedHandler(this, Sys.EventArgs.Empty);
            }
        }
    }
    AjaxControlToolkit.TextBoxWrapper.get_Wrapper = function(element) {
        if (null == element.AjaxControlToolkitTextBoxWrapper) {
            element.AjaxControlToolkitTextBoxWrapper = new AjaxControlToolkit.TextBoxWrapper(element);
        }
        return element.AjaxControlToolkitTextBoxWrapper;
    }
    AjaxControlToolkit.TextBoxWrapper.registerClass('AjaxControlToolkit.TextBoxWrapper', Sys.UI.Behavior); AjaxControlToolkit.TextBoxWrapper.validatorGetValue = function(id) {
        var control = $get(id); if (control && control.AjaxControlToolkitTextBoxWrapper) {
            return control.AjaxControlToolkitTextBoxWrapper.get_Value();
        }
        return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(id);
    }
    if (typeof (ValidatorGetValue) == 'function') {
        AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue; ValidatorGetValue = AjaxControlToolkit.TextBoxWrapper.validatorGetValue;
    }
    if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
        try {
            Sys.CultureInfo.prototype._getAbbrMonthIndex('');
        } catch (ex) {
            Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) {
                if (!this._upperAbbrMonths) {
                    this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
                }
                return Array.indexOf(this._upperAbbrMonths, this._toUpper(value));
            }
            Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex; Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;
        }
    }

}
if (window.Sys && Sys.loader) {
    Sys.loader.registerScript("ACTCommon", null, execute);
}
else {
	execute();
}

})();

